<div class="campushome-container">

	<div class="campushome-left">
    	<div class="looking">
          <% form_tag(:controller=>"search",:action=>"results",:university => params[:university]) do %>
	        <!--<div class="looking-for">
               	I am Looking for
            </div>
	        <div class="what">
            	<input value="E.g. Jobs,PG,Books,CAT Coachings etc." size="85" name="keyword" id="keyword" onclick="$(this).value=''" maxlength="100" class="input-box" type="text"/>
            </div>
			<div class="go_button">
              <%= image_submit_tag "search-button.jpg",:height=>22 -%>
            </div>
            <%end-%>
		</div>-->
		<div class="main-search-box">
			<div class="main-search-text2">
				I am Looking for
			</div>
			<div class="main-search-input2">
				<input value="E.g. Jobs,PG,Books,CAT Coachings etc." id="keyword" name="keyword" class="search-input-box2" type="text"  onclick="if(this.value=='E.g. Jobs,PG,Books,CAT Coachings etc.'){this.value=''};"/>
			</div>
			<div class="main-search-button">
				<%=image_tag "search-button.jpg",:onclick=>"openAjaxConfirmSearch(document.getElementById('keyword').value)",:style=>"cursor:pointer" -%>
			</div>
		</div>
        <div class="right-column-one">
          <%@user_types.each do |all_categories|%>
           <%@category=Category.find(all_categories.category_id.to_s)%>

	   		<div class="links">
         		<div class="category">
                	<div class="category-image">
                    	<%=image_tag @category.stripped_name+".png",:border=>0 -%>
                    </div>
                    <div class="category-text">
                    	<%= link_to h(@category.name), { :controller=> "listings", :action => "index" ,:category => @category.stripped_name , :university=>@university.stripped_name},:class=>"no_decoration" -%>
                    </div>
                </div>
         		<div class="sub-category">
                	<%@sub_categories=SubCategory.find(:all,:conditions=>"category_id="+@category.id.to_s)-%>
                    <%@sub_categories.each do |sub_category| %>
                    <%=sub_category.name -%><br>
                    <%end%>
                </div>

         	</div>

            <%end -%>
		</div>
        <div class="right-column-two">
	    	<%require 'htmlentities'
coder = HTMLEntities.new
%>


<div class="column-two-heading">Latest on SearchMyCampus</div>
    <%@user_types.each do |all_categories|%>
      <%@category=Category.find(all_categories.category_id.to_s)%>
      <%if @category.name!='Events' -%>
      <div class="column-boxes">

           <div class="post-tabs-heads">
                	<ul>
                        <li class="post-tabs-selected"><%= link_to h(@category.name), { :controller=> "listings", :action => "index" ,:category => @category.stripped_name , :university=>@university.stripped_name},:class=>"no_decoration" -%></li>
                    </ul>
          </div>
          <% @ads = @category.advertisments.find(:all, :limit => 3,:conditions=>"university_id="+@university.id.to_s, :order=>"created_at DESC") %>
          <div class="post-tabs-posts">
          <ul>
            <%@ads.each do |ad|%>
             <% @sub_category_name=SubCategory.find(ad.sub_category_id).name -%>

               <li>
                  <div class="latest-post-ads">
		                    	<div class="latest-post-ads-headings">
                               		<%= link_to h(coder.decode(excerpt(ad.title , ' ', 20))), {:controller =>"advertisments", :action=>"show" , :id=> ad.id } -%>

                                </div>
			                   	<div class="latest-post-ads-sub">
                                	<%=@category.name-%>/<%=@sub_category_name-%>
                                </div>
                                <div class="latest-post-ads-date">
                                	<%= ad.created_at.to_formatted_s(:long_ordinal) %>
                                </div>
				</div>
               </li>

               <%end%>

            </ul>
               <div class="more-ads">
                    	<div class="more-ads-text">
                        	<%= link_to  "More", { :controller=> "listings", :action => "index" ,:category => @category.stripped_name , :university=>@university.stripped_name},:class=>"no_decoration" -%>
                        </div>
                        <div class="more-ads-image">
                         <%= link_to (image_tag "more-ads.png",:width=>"6",:border=>0), { :controller=> "listings", :action => "index" ,:category => @category.stripped_name , :university=>@university.stripped_name},:class=>"no_decoration" -%>
                        </div>
                </div>
          </div>
       </div>
      <%end -%>
      <%end%>
  <div style="clear:both;">&nbsp;</div>

	     		</div>
     		</div>
             <div class="campushome-right">
    	 <div class="sign-in">
	     	<div class="sign-in-header">
		 		Registered User-Sign In
		 	</div>
            <div class="sign-in-inner">
              <% form_tag(:controller=>"login",:action => "process_login") do %>
                 <div class="username">
                	<div class="username-text">
	                	Username:
    				</div>
                    <div class="username-value">
                    	<%= text_field "user", "name",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                    </div>
                </div>
                <div class="password">
                    <div class="password-text">
                    	Password:
                    </div>
                    <div class="password-value">
                    	<%= password_field "user", "password",:class=>"input-box",:maxlength=>80,:size=>26 -%>&#x00A;
                    </div>
                </div>
                <div class="sign-in-button">
                   <%= image_submit_tag "sign-in-button.jpg" -%>
                </div>
                <div class="sign-in-problem">
                	<a href="">Can't access your account?</a>
                </div>
                <% end %>
			</div>
        </div>
        <div class="new-user">
	     	<div class="new-user-header">
		 		New User?
		 	</div>
            <div class="new-user-inner">
               <% form_tag(:controller=>"registration",:action => "step1",:university=>params[:university]) do %>
                <div class="new-user-email">
                	<div class="new-user-email-text">
	                	Email ID:
    				</div>
                    <div class="new-user-email-value">
                        <%= text_field "user", "email",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                    </div>
                </div>
                <div class="new-user-mobile">
                	<div class="new-user-mobile-text">
	                	Mobile No:
    				</div>
                    <div class="new-user-mobile-value">
                    	<%= text_field "user", "mobile_no",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                   </div>
                </div>
                <div class="sign-in-button">
                    <%= image_submit_tag "create-account-button.jpg" -%>
                </div>
                <div class="sign-in-problem">
                	<a href="">Not a student?</a>
                </div>
                <%end -%>
			</div>
        </div>
        <div class="right-boxes">
	     	<div class="right-boxes-header">
		 		Popular Searches
		 	</div>
            <div class="right-boxes-inner">
            PGs Hudsonlane Tutions saket Part time jobs internship paying guest Nokia mobiles Fresher Jobs online data Engineer Reliance Hostel DU admission
            </div>
    	</div>
		<div class="latest-listing">
	     	<div class="latest-listing-header">
		 		Latest listings by Email
		 	</div>
            <div class="latest-listing-inner">
                <div class="latest-listing-email">
                	<div class="latest-listing-email-text">
	                	Email ID:
    				</div>
                    <div class="latest-listing-email-value">
                    	  <%= text_field "user", "email",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                    </div>
    			</div>
                <div class="sign-in-button">
                  <%= image_submit_tag "latest-listing-button.jpg" -%>
               </div>
    		</div>
    	</div>
        <div class="user-speaks">
			<div class="user-speaks-header">
            	User Speak
            </div>
            <div class="user-speaks-inner">
                <div class="user-speaks-text">
                	&quot;I've found a job I love, in an industry that is totally related to what I did in college, all because of SearchMy Campus.&quot;
                	<div class="user-speaks-name">
                    	<br/>Aarti Sharma<br/>
                        Delhi University
                    </div>
                </div>
                <div class="user-speaks-image">
                  <%=image_tag "user-speaks.png",:width=>100,:border=>0 -%>
                </div>
			</div>
        </div>
        <div class="things-to-do">
          <%=image_tag "thingsyoucando.jpg",:width=>298,:border=>0,:alt=>"search my campus" -%>
	     </div>
        <div class="right-boxes">
	     	<div class="right-boxes-header">
		 		How to use SearchMyCampus
		 	</div>
            <div class="right-boxes-inner">
            	Tips and info on how to use SearchMyCampus
            </div>
    	</div>
	</div>
</div>
                     